<template>
	<view class="container">
		<!-- <view class="feedback">
			<view class="body" v-for="item in feedList" :key="item.id">
				<view class="title">我是标题</view>
				<view class="title">{{item.title}}</view>
				<view class="content">我是意见反馈我是意见反馈我是意见反馈我是意见反馈我是意见反馈我是意见反馈</view>
				<view class="content">意见:{{item.content}}</view>
				<view class="content">回复:{{item.reply}}</view>
			</view>
			<view class="arrow"></view>
		</view> -->
		<uni-card v-for="item in feedList" :key="item.id">
			<view>
				<!-- <view class="title">我是标题</view> -->
				<view class="title">{{item.title}}</view>
				<!-- <view class="content">我是意见反馈我是意见反馈我是意见反馈我是意见反馈我是意见反馈我是意见反馈</view> -->
				<view class="content">意见:{{item.content}}</view>
				<view class="content">回复:{{item.reply}}</view>
			</view>
			<!-- <view class="arrow"></view> -->
		</uni-card>
		<view class="down">
			<button type="primary" class="btn" @click="toSend">写反馈</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				valiFormData: {
					uid: uni.getStorageSync('userInfo').id
				},
				feedList: [],
			}
		},
		onLoad() {
			this.getFeed()
		},
		methods: {
			getFeed() {
				uni.request({
					url: 'http://localhost:8080/user/opinion/list',
					header: {
						'Authorization': 'Bearer ' + wx.getStorageSync('token')
					},
					method: "GET",
					data: this.valiFormData,
					success: (resp) => {
						//console.log('resp', resp)
						if (resp.data.code == 200) {
							this.feedList = resp.data.rows
							console.log("this.feedList", this.feedList)
						}
					}
				})
			},
			toSend() {
				uni.navigateTo({
					url: '/pages/my/feedback/sendFeedback/sendFeedback'
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	.container {
		width: 100%;
	}

	.feedback {
		display: flex;
		width: auto;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 50rpx;
		border-bottom: 2rpx solid #eee;
	}

	.body {
		width: 500rpx;
	}

	.title {
		font-weight: bold;
		font-size: 36rpx;
		padding-bottom: 12rpx;
	}

	.content {
		display: -webkit-box;
		/* 设置为WebKit内核的弹性盒子模型 */
		-webkit-box-orient: vertical;
		/* 垂直排列 */
		-webkit-line-clamp: 1;
		/* 限制显示两行 */
		overflow: hidden;
		/* 隐藏超出范围的内容 */
		text-overflow: ellipsis;
		/* 使用省略号 */
		font-weight: normal;
		font-size: 28rpx;
	}

	.arrow {
		width: 30rpx;
		height: 30rpx;
		border-top: 2rpx solid #ccc;
		border-right: 2rpx solid #ccc;
		transform: rotate(45deg);
	}

	.down {
		position: fixed;
		width: 100%;
		bottom: 100rpx;
	}

	.btn {
		width: 80%;
		border-radius: 50rpx;
	}
</style>